xen: arm: use symbolic names for MPIDR bits.
authorIan Campbell <ian.campbell@citrix.com>
Fri, 20 Sep 2013 16:51:20 +0000 (17:51 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 27 Sep 2013 15:49:51 +0000 (16:49 +0100)
arm32 already uses MPIDR_HWID_MASK, use it on arm64 too. Add MPIDR_{SMP,UP}
(and bitwise equivalents) and use them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/arm/arm32/head.S
xen/arch/arm/arm64/head.S
xen/include/asm-arm/processor.h

index 510ccff3edbad376d0f8fd277c2a6b3aa53907b8..92b3c4896f882df44220e18ea00a506922b60e89 100644 (file)
@@ -127,9 +127,9 @@ common_start:
                                       * find that multiprocessor extensions are
                                       * present and the system is SMP */
         mrc   CP32(r1, MPIDR)
-        tst   r1, #(1<<31)           /* Multiprocessor extension supported? */
+        tst   r1, #MPIDR_SMP         /* Multiprocessor extension supported? */
         beq   1f
-        tst   r1, #(1<<30)           /* Uniprocessor system? */
+        tst   r1, #MPIDR_UP          /* Uniprocessor system? */
         bne   1f
         bic   r7, r1, #(~MPIDR_HWID_MASK) /* Mask out flags to get CPU ID */
 1:
index b2d44ccf4cf03eeb941e1ed1350013b5f2d8b868..062645ed7777126cc6a50eff6f9a680d92f4dce2 100644 (file)
@@ -153,10 +153,10 @@ common_start:
                                       * find that multiprocessor extensions are
                                       * present and the system is SMP  */
         mrs   x0, mpidr_el1
-        tbz   x0, 31, 1f             /* Multiprocessor extension not supported? */
-        tbnz  x0, 30, 1f             /* Uniprocessor system? */
+        tbz   x0, _MPIDR_SMP, 1f     /* Multiprocessor extension not supported? */
+        tbnz  x0, _MPIDR_UP, 1f      /* Uniprocessor system? */
 
-        mov   x13, #(0xff << 24)
+        mov   x13, #(~MPIDR_HWID_MASK)
         bic   x24, x0, x13           /* Mask out flags to get CPU ID */
 1:
 
index 06464227e34b7658bad663c58ae3a6ea01df233a..529442152ecdabfa3bb7dea4ad00db4d15e1e6d6 100644 (file)
@@ -8,11 +8,13 @@
 #define MIDR_MASK    0xff0ffff0
 
 /* MPIDR Multiprocessor Affinity Register */
-#define MPIDR_UP            (1 << 30)
-#define MPIDR_SMP           (1 << 31)
+#define _MPIDR_UP           (30)
+#define MPIDR_UP            (_AC(1,U) << _MPIDR_UP)
+#define _MPIDR_SMP          (31)
+#define MPIDR_SMP           (_AC(1,U) << _MPIDR_SMP)
 #define MPIDR_AFF0_SHIFT    (0)
-#define MPIDR_AFF0_MASK     (0xff << MPIDR_AFF0_SHIFT)
-#define MPIDR_HWID_MASK     0xffffff
+#define MPIDR_AFF0_MASK     (_AC(0xff,U) << MPIDR_AFF0_SHIFT)
+#define MPIDR_HWID_MASK     _AC(0xffffff,U)
 #define MPIDR_INVALID       (~MPIDR_HWID_MASK)
 
 /* TTBCR Translation Table Base Control Register */